import {baseRequest} from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/security/rule/` + url, ...arg)

export default {
	async fetchRulePage(query) {
		return await request('page', query, 'get')
	},
	async fetchRuleList(query) {
		return await request('list', query, 'get')
	},
	async createRule(data) {
		return await request('create', data, 'post')
	},
	async updateRule(data) {
		return await request('update', data, 'post')
	},
	async deleteRule(data) {
		return await request('delete', data, 'post')
	},
	async updateRuleEnableStatus(id, enable) {
		return await request('update/enable-status',  {
			id: id,
			enable: enable
		}, 'post')
	},
}
